Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Store the ouput of `which` in a local macro

    Hello everyone,

    I am writing a command that I would like to distribute. I would like to be able to use the location of the main ado file in my code. It's easy to find using the bult-in command which.

    Code:
    . which mycommand
    c:\ado\personal\mycommand.ado
    However, I don't know how to store the output of which in a local macro. Is it possible? And if not, any idea on how to proceed? Thank you very much.

  • #2
    If which can find a file, what depends on knowing where it is? (Once I find my pen, or see my luggage on the carousel, I no longer need to worry where it is.)

    Otherwise which is built-in code and doesn't emit saved results that I can discern, other than what it displays.

    For your purposes findfile is very possibly a better bet.
    Last edited by Nick Cox; 02 Jul 2018, 08:11.

    Comment


    • #3
      Thank for your fast answer. I want to find where the ado file is, because there are some dependencies in the package (do-files, dta files, VB scripts, HTML documentation) that I need to find when the command is run.

      findfile is exactly what I was looking for. Thank you so much!

      Comment

      Working...
      X